//
//  HotPost.m
//  初稿
//
//  Created by lanou3g on 15/7/18.
//  Copyright (c) 2015年 多飞科技. All rights reserved.
//

#import "HotPost.h"

@implementation HotPost

- (id)copyWithZone:(NSZone *)zone{
    
    HotPost *SedHotPost=[[HotPost allocWithZone:zone]init];
    
    
    
    SedHotPost.title = self.title;
    SedHotPost.post_logo = self.post_logo;
    SedHotPost.post_name = self.post_name;
    SedHotPost.post_avatar = self.post_avatar;
    SedHotPost.post_idSB = self.post_idSB;
    SedHotPost.post_timeSB = self.post_timeSB;
    SedHotPost.comment_countSB = self.comment_countSB;
    SedHotPost.praise_countSB = self.praise_countSB;
    SedHotPost.post_avatarImage = self.post_avatarImage;
    SedHotPost.post_logoImage = self.post_logoImage;
    SedHotPost.weiba_id = self.weiba_id;
    SedHotPost.contentSB = [[NSString alloc]initWithFormat:@"%@",self.contentSB];
    
    return SedHotPost;
    
}

-(void)setValue:(id)value forUndefinedKey:(NSString *)key{
    
    if ([key isEqualToString:@"post_id"]) {
        self.post_idSB = [NSString stringWithFormat:@"%@",value];
    }
    
    if ([key isEqualToString:@"content"]) {
        
        NSString * contentStr = [value stringByReplacingOccurrencesOfString:@"&nbsp;" withString:@" "];
        NSString * content = [contentStr stringByReplacingOccurrencesOfString:@"<br/>" withString:@"\n"];
        
        self.contentSB=content;
    }
    
    if ([key isEqualToString:@"post_time"]) {
        
        NSDate *nd=[NSDate dateWithTimeIntervalSince1970:(float)[value floatValue]];
        NSDateFormatter *dateFormatter=[[NSDateFormatter alloc]init];
        [dateFormatter setDateFormat:@"MM-dd HH:mm"];
        NSString *dateStr=[dateFormatter stringFromDate:nd];
        self.post_timeSB=dateStr;
//        NSLog(@"dd = %@",dateStr);
    }
    if ([key isEqualToString:@"post_time"]) {
        
        self.time = [NSString stringWithFormat:@"%@",value];
        
    }
    
    
    if ([key isEqualToString:@"comment_count"]) {
        self.comment_countSB = [NSString stringWithFormat:@"%@",value];
    }
    
    if ([key isEqualToString:@"praise_count"]) {
        self.praise_countSB = [NSString stringWithFormat:@"%@",value];
    }
    
    if ([key isEqualToString:@"weiba_id"]) {
        self.weiba_id = [NSString stringWithFormat:@"%@",value];
    }
    
    
}

















@end
